<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');
?>
<form action="?m=ushop&c=tools&a=sale_general&menuid=<?php echo $_GET['menuid'];?>" method="post"  style="margin:10px auto; width:99%;">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td>
        <div class="explain-col" style="text-align:left;">
			<?php echo '开始时间'; ?>:
			<?php echo form::date('search[start_time]','','')?> 
			<?php echo '开始时间';?>   
			<?php echo form::date('search[end_time]','','')?>    
            <input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit">
		</div>
		</td>
		</tr>
    </tbody>
</table>
</form>

<form action="?m=ushop&c=tools&a=sale_order&menuid=<?php echo $_GET['menuid'];?>" method="post" id="sale_form">
<div class="table-list" style="width:99%; margin:auto;">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th width="20%" align="center">排行</th>
			<th width="31%" align="center">商品名称</th>
			<th width='17%' align="center">销售量&nbsp;</th>
			<th width="17%" align="center">销售额&nbsp;</th> 
            <th width="17%" align="center">均价</th>
		</tr>
	</thead>
<tbody>
<?php
if(is_array($new_array) && !empty($new_array)){
	$i = 1;
	foreach($new_array as $key => $info){
?>
	<tr>
		<td align="center"><?php echo $i; ?></td>
		<td align="center"><?php echo $info['title']; ?></td>
		<td align="center"><?php echo $info['i'];?></td>
		<td align="center"><?php echo $info['price']?></td>
        <td align="center"><?php echo $info['price']/$info['i']; ?></td>
	</tr>
	<?php
	$i ++;
	}
}elseif(empty($new_array)) {
?>
	<tr>
    	<td colspan="5" align="center">暂时还没有数据</td>
    </tr>
<?php
}
?>
</tbody>
</table>
</div>
</form>
</body>
</html>